/*
package com.xiaoluyy.demo.config;

import com.xiaoluyy.demo.common.util.ThriftRpcClient;
import com.xiaoluyy.demo.common.util.ThriftRpcClientConfig;
import com.xiaoluyy.demo.thrift.DemoService1;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.List;

*/
/**
 * Thrift client configuration
 *//*

@Configuration
public class ThriftClientConfig {

    @Value("${thrift.client.demo.name}")
    String thriftClientNamme;
    
    @Value("${thrift.client.demo.upstreamAddr}")
    String serviceUpstreamAddr;
    
    @Value("${thrift.client.demo.configfile}")
    private String thriftClientConfFile;
    
    @Value("${thrift.client.demo.registerFlag}")
    private String registerFlag;
    
    @Value("${thrift.client.demo.isMulti}")
    private String isMulti;
    
    @Value("${thrift.client.demo.nonBlockFlag}")
    private String nonBlockFlag;


    @Bean(name = "thriftRpcClient",initMethod = "startup", destroyMethod = "shutdown")
    public ThriftRpcClient getThriftRpcClient() {
        ThriftRpcClient thriftRpcClient = new ThriftRpcClient(thriftClientConfFile);
        thriftRpcClient.setServiceClientName(thriftClientNamme);

        List<ThriftRpcClientConfig> serviceConfigs = new ArrayList<ThriftRpcClientConfig>();

        //使用其它client时继续添加

        // demoService1
        ThriftRpcClientConfig demoService1Config = new ThriftRpcClientConfig();
        demoService1Config.setServiceClazz(DemoService1.class.getName());
        demoService1Config.setRegisteFlag(Boolean.valueOf(registerFlag));
        demoService1Config.setTframedFlag(Boolean.valueOf(nonBlockFlag));
        demoService1Config.setMultiFlag(Boolean.valueOf(isMulti));
        demoService1Config.setServerAddr(serviceUpstreamAddr);
        serviceConfigs.add(demoService1Config);
        // demoService2
        */
/*ThriftRpcClientConfig demoService2Config = new ThriftRpcClientConfig();
        demoService1Config.setServiceClazz(DemoService2.class.getName());
        demoService1Config.setRegisteFlag(Boolean.valueOf(registerFlag));
        demoService1Config.setTframedFlag(Boolean.valueOf(nonBlockFlag));
        demoService1Config.setMultiFlag(Boolean.valueOf(isMulti));
        demoService1Config.setServerAddr(serviceUpstreamAddr);
        serviceConfigs.add(demoService2Config);*//*


        thriftRpcClient.setServiceConfigList(serviceConfigs);
        return thriftRpcClient;
    }
    
    //如果需要多个ThriftRpcClient，上面方法继续实现，name不一样即可

}
*/
